package com.zh.web.domain.system.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zh.web.base.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("socket消息格式")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Builder(toBuilder = true)
public class MessageDto extends BaseDto {
    @ApiModelProperty("消息唯一Id 自动生成 无需传入")
    private Long id;
    @ApiModelProperty(value = "消息发送者id", example = "1835979905138909185")
    private Long fromId;
    @ApiModelProperty(value = "消息接收者id 自己发给自己也是可以的", example = "[1835979905138909185]")
    private List<Long> toIdList;
    @ApiModelProperty("消息体 字符串格式(前后端互通) 可以为JSON")
    private String content;
    @ApiModelProperty("消息类型")
    private String type;
    @ApiModelProperty(value = "消息模板,模板表选取,默认无模板" +
            ",当存在模板时按照模板序列化content," +
            "举例:验证码模板 您的验证码为${code},${minute}分钟内有效 content序列化:{'code':4399,'minute':5}"
            , example = "1008611")
    private Long templateId;
    @ApiModelProperty("发送时间")
    private LocalDateTime sendTime;
}
